package com.wu.service.impl;

import com.wu.bean.Journal;
import com.wu.dao.JournalDao;
import com.wu.dao.impl.JournalDaoImpl;
import com.wu.model.JournalModel;
import com.wu.service.JournalService;

import java.util.List;

public class JournalServiceImpl implements JournalService {
    JournalDao journalDao=new JournalDaoImpl();
    @Override
    public void AddLog(Journal journal) {
        journalDao.saveJournal(journal);
    }

    @Override
    public int UpdateLog(Journal journal) {
        return journalDao.updateJournal(journal);
    }

    @Override
    public JournalModel QueryLog(int id) {
        return journalDao.queryJournalID(id);
    }

    @Override
    public List<JournalModel> QueryLogAll() {
        return journalDao.queryJournalAll();
    }

    @Override
    public int DeleteLog(int id) {
       return journalDao.deleteJournal(id);
    }

    @Override
    public List<JournalModel> FuzzyQueryLog(String like) {
        return journalDao.queryJournalLike(like);
    }

    @Override
    public List<JournalModel> queryJournalLimitTen() {
        return journalDao.queryJournalLimitTen();
    }

    @Override
    public List<JournalModel> queryJournalCommentolumeFive() {
        return journalDao.queryJournalCommentolumeFive();
    }

    @Override
    public List<JournalModel> queryJournalHitsFive() {
        return journalDao.queryJournalHitsFive();
    }

    @Override
    public int updateHits(int id, int hits) {
        return journalDao.updateHits(id,hits);
    }

    @Override
    public int updateCommentolume(int id, int Commentolume) {
        return journalDao.updateCommentolume(id,Commentolume);
    }

    @Override
    public JournalModel queryJournalTopOne(int id) {
        return journalDao.queryJournalTopOne(id);
    }

    @Override
    public JournalModel queryJournalBunOne(int id) {
        return journalDao.queryJournalBunOne(id);
    }
}
